<template>
	<view class="page">
		<view class="title">
			5.10.showActionSheet从底部向上弹出操作菜单
		</view>
		<view class="p">
			<view class="p">
				官网链接API
				<uni-link href="https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet"
					text="交互反馈showActionSheet" color="#007BFF"></uni-link>
			</view>
		</view>
		<view class="p">
			<button @click="shareto">分享到 <text>{{sharedone}}</text> </button>
		</view>

	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'

	const sharedone = ref("")

	let arrs = ['QQ', '微博', '微信', '微信朋友圈']

	const shareto = () => {
		uni.showActionSheet({
			title: "分享到",
			itemList: arrs,
			success: (res) => {
				sharedone.value = arrs[res.tapIndex]
				uni.showToast({
					title: "分享到了" + arrs[res.tapIndex],
					icon: "none"
				})

				console.log(arrs[res.tapIndex]);
			},
			fail: (res) => {
				console.log(res.errMsg);
			}
		});
	}
</script>

<style lang="scss" scoped>

</style>